import time
from selenium import webdriver
from selenium.webdriver.common.by import By

# 打开浏览器
driver = webdriver.Chrome()
# 2.输入访问地址（URL）
driver.get("http://121.43.169.97:8848/pageA.html")
# 3.页面信息操作

driver.maximize_window()  # 放大窗口
# Xpath定位
driver.find_element(by=By.XPATH, value=".//*[@id='userA']").send_keys("admin")
driver.find_element(by=By.XPATH, value=".//*[@id='passwordA']").send_keys("123456")
driver.find_element(by=By.XPATH, value=".//*[@id='telA']").send_keys("17777429832")
driver.find_element(by=By.XPATH, value="html/body/div/fieldset/form/p[4]/input").send_keys("1847560271@qq.com")

# driver.find_element(by=By.XPATH, value="html/body/div/fieldset/form/p[5]/button").click()  # 点击注册按钮

driver.find_element(by=By.XPATH, value=".//*[@id='alerta']").click()  # 点击alert按钮

time.sleep(3)
# 4.关闭/退出浏览器
driver.quit()
